package com.easyj.admin.db.model;

import com.easyj.base.cache.SysCacheUtil;
import com.easyj.base.common.bean.BaseBean;
import java.util.Date;

/**
 *   @title 任务审批意见（自定义）
 *   @remark 
 *   @table act_task_comment
 *   @primaryKey id
 *   @enablePage false
 */
public class TaskComment extends BaseBean {
    private static final long serialVersionUID = 1L;

    /**
     *   @title 
     *   @remark 
     *   @column id
     *   @dataType BIGINT
     *   @length 19
     *   @scale 0
     *   @nullable false
     *   @jdbcType BIGINT
     */
    private Long id;

    /**
     *   @title 
     *   @remark 
     *   @column type
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String type;

    /**
     *   @title 
     *   @remark 
     *   @column create_time
     *   @dataType DATETIME
     *   @length 19
     *   @scale 0
     *   @nullable false
     *   @jdbcType TIMESTAMP
     */
    private Date createTime;

    /**
     *   @title 
     *   @remark 
     *   @column user_id
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String userId;

    /**
     *   @title 
     *   @remark 
     *   @column task_id
     *   @dataType VARCHAR
     *   @length 64
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String taskId;
    

    /**
     *   @title 任务名称
     *   @remark 
     *   @column task_name
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String taskName;

    /**
     *   @title 
     *   @remark 
     *   @column proc_inst_id
     *   @dataType VARCHAR
     *   @length 64
     *   @scale 0
     *   @nullable false
     *   @jdbcType VARCHAR
     */
    private String procInstId;

    /**
     *   @title 
     *   @remark 
     *   @column action
     *   @dataType VARCHAR
     *   @length 255
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String action;

    /**
     *   @title 
     *   @remark 
     *   @column message
     *   @dataType VARCHAR
     *   @length 2000
     *   @scale 0
     *   @nullable true
     *   @jdbcType VARCHAR
     */
    private String message;
    
    
    public String getUserName(){
    	try {
    		if(userId!=null) {
    	      return SysCacheUtil.getOperatorName(Long.parseLong(userId));
    		}else {
    			return "";
    		}
    	}catch(Exception ex) {
    		return "";
    	}
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getTaskId() {
        return taskId;
    }

    public void setTaskId(String taskId) {
        this.taskId = taskId;
    }

    public String getProcInstId() {
        return procInstId;
    }

    public void setProcInstId(String procInstId) {
        this.procInstId = procInstId;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TaskComment other = (TaskComment) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", id=").append(id);
        sb.append(", type=").append(type);
        sb.append(", createTime=").append(createTime);
        sb.append(", userId=").append(userId);
        sb.append(", taskId=").append(taskId);
        sb.append(", procInstId=").append(procInstId);
        sb.append(", action=").append(action);
        sb.append(", message=").append(message);
        sb.append("]");
        return sb.toString();
    }

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}
    
    
}